package ir.sourcecodes.animalsounds;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.pushpole.sdk.PushPole;

public  class ads {

    public static void init(Context context){
        MobileAds.initialize(context, new OnInitializationCompleteListener() {
            @Override
            public void onInitializationComplete(InitializationStatus initializationStatus) {
            }
        });
    }

    public static void showBan(Context context, Activity paramActivity) {
        LinearLayout linearLayout = (LinearLayout)paramActivity.findViewById(R.id.llad);
        AdView adView = new AdView((Context)paramActivity);
        adView.setAdSize(AdSize.BANNER);
        adView.setAdUnitId(context.getResources().getString(R.string.adbanner));
        adView.loadAd((new AdRequest.Builder()).build());
        linearLayout.addView((View)adView);
    }

    public static void showFull(Context context) {
        final InterstitialAd mInterstitialAd = new InterstitialAd(context);
        mInterstitialAd.setAdUnitId(context.getResources().getString(R.string.adinter));
        mInterstitialAd.loadAd((new AdRequest.Builder()).build());
        mInterstitialAd.setAdListener(new AdListener() {
            public void onAdLoaded() {
                mInterstitialAd.show();
            }
        });


    }
    public static void pushe(Context context) {
        PushPole.initialize(context,true);

    }

}
